Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make fileActions mixin standalone again. #6453

Merged
merged 2 commits into from
Feb 18, 2022

Conversation

dschmidt
Copy link
Member

Description

In #6445 we introduced a dependency on isFilesAppActive for the fileActions mixin. We added it to
ContextActions and BatchActions, but there are way more places where the mixin is used. That's why
we add a computed to the mixin itself now. Because mixins belong to the options api we unfortunately
cannot use composables directly and extract helper functions for that reason.

Related Issue

  • Fixes <issue_link>

Motivation and Context

How Has This Been Tested?

  • test environment:
  • test case 1:
  • test case 2:
  • ...

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

Open tasks:

  • ...

@update-docs
Copy link

update-docs bot commented Feb 18, 2022

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@dschmidt dschmidt force-pushed the make_fileactions_mixin_standalone branch from fe1ef1f to a07f09f Compare February 18, 2022 10:05
In #6445 we introduced a dependency on isFilesAppActive for the fileActions mixin. We added it to
ContextActions and BatchActions, but there are way more places where the mixin is used. That's why
we add a computed to the mixin itself now. Because mixins belong to the options api we unfortunately
cannot use composables directly and extract helper functions for that reason.
@dschmidt dschmidt force-pushed the make_fileactions_mixin_standalone branch from a07f09f to 5920d71 Compare February 18, 2022 12:09
@@ -44,6 +39,11 @@ export default {
Move,
Restore
],
setup() {
return {
isFilesAppActive: useIsFilesAppActive()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused, can't you delete this again with the helper function now being used in the mixins?

@@ -55,6 +58,12 @@ export default {
...mapGetters('Files', ['highlightedFile', 'currentFolder']),
...mapGetters(['capabilities', 'configuration']),

// TODO: Replace this with the useIsFilesAppActive composable
// once we port this mixin to something using the composition api
isFilesAppActive() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wow, is it really sufficient to provide the function here? Are we using the fileActions mixin really in all locations that use any of the specific file action mixins?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's why the composable is still used in BatchActions ...
We include single actions there and not the fileActions mixin.

... but that's a very good point, this has become hard to reason about. I will add this to all the mixins :(

…n that needs it.

It's very hard to figure out if dependencies are provided to mixins in every single location they are used in, hence we remove the external dependency.
@sonarcloud
Copy link

sonarcloud bot commented Feb 18, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

33.3% 33.3% Coverage
0.0% 0.0% Duplication

@ownclouders
Copy link
Contributor

Results for oCISSharingInternal2 https://drone.owncloud.com/owncloud/web/22895/60/1
The following scenarios passed on retry:

  • webUISharingInternalUsers/shareWithUsers.feature:342

@ownclouders
Copy link
Contributor

Results for oCISTrashbinUploadMoveJourney https://drone.owncloud.com/owncloud/web/22895/69/1
The following scenarios passed on retry:

  • webUIUserJourney/journey1.feature:11

Copy link
Member

@kulmann kulmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@kulmann kulmann merged commit 9453255 into master Feb 18, 2022
@delete-merged-branch delete-merged-branch bot deleted the make_fileactions_mixin_standalone branch February 18, 2022 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants